" Vim syntax file
" Language:	singlog
" Maintainer:	stupidsing@gmail.com

if exists("b:current_syntax")
  finish
endif

syn case match

" keywords
syn keyword	singlogKeyword fail yes
syn keyword singlogKeyword let
syn keyword	singlogKeyword get set unset
syn keyword	singlogKeyword load import
syn keyword	singlogKeyword once select if then else
syn keyword	singlogKeyword try catch raise
syn keyword	singlogKeyword synchronized

syn match	singlogId "\<\w\+[\w\d\.]*"

syn match	singlogVariable "\.\w\+[\w\d.]*"
syn match	singlogVariable "\.\s"

syn region	singlogString start=+'+  end=+'+
syn region	singlogString start=+"+  end=+"+

" integer numbers
syn match	singlogNumber "-\=\<\d\+\>"

" operators
syn keyword	singlogOperator and or mod
syn match	singlogOperator "\- "
syn match	singlogOperator ":\-"
syn match	singlogOperator "[><=+*\/,;!()\[\]?#|]"

syn match	singlogComment "--.*$"
syn region	singlogComment start="-=" end="=-"

" Define the default highlighting
if version >= 508 || !exists("did_singlog_syntax_inits")
  command -nargs=+ HiLink hi def link <args>

  HiLink singlogId			Default
  HiLink singlogOperator	Statement
  HiLink singlogKeyword		Statement
  HiLink singlogString		Special
  HiLink singlogVariable	Identifier
  HiLink singlogComment		String
  HiLink singlogNumber		Identifier

  delcommand HiLink
endif

let b:current_syntax = "singlog"

" vim: ts=4
